<?php
namespace App\Services\Fund;
use App\Services\Fund\CurrencyOptionLog\CurrencyOptionLogLogic;
/**
 * 数字币操作记录
 * Class CurrencyOptionLog
 * @package App\Services\Fund
 */
class CurrencyOptionLog
{
    // 获取所数字币操作日志(分页)
    public function list($data): array
    {
        $data = init_array($data,['page'=>'1', 'list_rows'=>'', 'type'=>'', 'keywords'=>'', 'startTime'=>'', 'endTime'=>'']);
        if (!empty($startTime) && !empty($endTime) && $startTime>$endTime ) {
            return null_data($data,"开始时间必须小于结束时间！");
        }
        return (new CurrencyOptionLogLogic())->list($data);
    }
    // 获取某些user_ids的的数字币操作日志(分页)
    public function listByUserIds($data): array
    {
        $data = init_array($data,['page'=>'1', 'list_rows'=>'', 'user_ids'=>' ']);
        ValidateCurrencyOptionLog::checkValidate($data, ['user_ids']);
        return (new CurrencyOptionLogLogic())->listByUserIds($data);
    }
    // 获取某个用户某个状态的数字币操作日志分页数据
    public function listByUserType($data): array
    {
         $data = init_array($data,['user_id'=>'0', 'type'=>'', 'page'=>'1', 'list_rows'=>15, 'money'=>'', 'time'=>'']);
        ValidateCurrencyOptionLog::checkValidate($data, ['user_id','type','money','time']);
        return (new CurrencyOptionLogLogic())->listByUserType($data);
    }

}